﻿@using NOSDC.Utility
@model IEnumerable<NOSDC.Pocos.Document>

@{
    ViewBag.Title = "Index";
}
@Html.ActionLink("Create a new document", "CreateDocument", "Documents")
<br /><br />
@foreach (var item in Model)
{
    <div class="downloadWrapper">
        <div class="downloadTitle">@Html.ActionLink(@item.Title, "UpdateDocument", new { id = @item.DocumentID})</div>
        <div style="float:right;margin-top:-20px;">
            @using (Html.BeginForm("Delete", "Documents", new { id = item.DocumentID }, FormMethod.Post))
            {
                <input type="image" title="Delete" alt="Delete" src='@Url.Content("~/Areas/Admin/Images/icon-deleteX-transparent.png")' onclick="return confirm('Are you sure you want to delete this document?');" />
            }
        </div>
        <div class="fileIcon"><img src="../Images/@Helper.GetIconType(item.DocumentType)" alt="@item.DocumentType"></img></div>
        <div class="downloadDescription">@item.Description</div>
        <div style="padding-top:5px; float:right;"><strong>Uploaded by</strong>: @Membership.GetUser(item.UploadedBy).UserName at @item.UploadDate</div>
        <div class="clear"></div>
    </div>
    <br />
}